package StringTest;


/**
 * 6.1. 将手机号中间的四位隐藏; 换成如:17334568987换成173****8987
 * 
 * @author AcerMr
 *
 */
public class StringAdd
{
	public static void main(String[] args)
	{
		StringBuilder phone_num = new StringBuilder("12244378943");
		String b = phone_num.substring(0, 1);
		if (b.equals("1"))
		{
			if (phone_num.length() > 11 || phone_num.length() < 0)
			{
				System.out.println("请输入正确的电话号码！");
			} else
			{		
				try
				{
					String c = phone_num.substring(1,5);	
					String d = phone_num.substring(5);
					Integer.valueOf(c).intValue();
					Integer.valueOf(d).intValue();
					phone_num.replace(3, 7, "***");
					System.out.println(phone_num);
				} catch (Exception e)
				{
					System.out.println("请输入正确的电话号码！");
				}
			}
		} else
		{
			System.out.println("请输入正确的电话号码！");
		}
		
	
	}
}
